#include "identifiimg.h"
#include "source/logger.h"


IdentifiImg::IdentifiImg()
{
}

void IdentifiImg::setImage(cv::Mat img)
{
    img_ = img.clone();
}

void IdentifiImg::setRoi(int x, int y, int width, int height)
{
    roi_.x = x;
    roi_.y = y;
    roi_.width = width;
    roi_.height = height;
}

void IdentifiImg::setRoi(cv::Rect2d rect)
{
    roi_ = rect;
}

cv::Mat IdentifiImg::getImage()
{
    if(img_.empty())
    {

        //LogWarning<<"Fail read IdentifiImg Because IdentifiImg is Empty";
    }
    return img_;
}

bool IdentifiImg::isEmpty()
{
    return img_.empty();
}

cv::Rect2d IdentifiImg::getRoi()
{
    return roi_;
}

void IdentifiImg::clear()
{
    img_  = cv::Mat();
}


